<!DOCTYPE html>


<html lang="en">
  

    <head>
      <meta charset="utf-8" />
        
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title>最新版本KeepalivedGBase8s(leopard)猎豹版 |  朝花夕拾</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/ww.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      
<link rel="stylesheet" href="/css/fonts/remixicon.css">

      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      <section class="outer">
  <article
  id="post-最新版本KeepalivedGBase8s-leopard-猎豹版"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  最新版本KeepalivedGBase8s(leopard)猎豹版
</h1>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/06/15/%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%ACKeepalivedGBase8s-leopard-%E7%8C%8E%E8%B1%B9%E7%89%88/" class="article-date">
  <time datetime="2023-06-15T12:16:37.000Z" itemprop="datePublished">2023-06-15</time>
</a> 
  <div class="article-category">
    <a class="article-category-link" href="/categories/GBase8s/">GBase8s</a>
  </div>
  
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> Word count:</span>
            <span class="post-count">1.6k</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> Reading time≈</span>
            <span class="post-count">8 min</span>
        </span>
    </span>
</div>
 
    </div>
      
    <div class="tocbot"></div>




  
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="部署方法"><a href="#部署方法" class="headerlink" title="部署方法"></a>部署方法</h1><p>0， 提取软件<br>      链接：<a target="_blank" rel="noopener" href="https://pan.baidu.com/s/1U6DBLTeKjffnaawOyt6vTw">https://pan.baidu.com/s/1U6DBLTeKjffnaawOyt6vTw</a><br>      提取码：6789</p>
<p>1,  编辑 config_files.txt 填写你的真实数据</p>
<p>2,  执行  .&#x2F;config_files.sh</p>
<p>3,  把 config_files 目录的文件上传到正确的为位置即可。</p>
<p>4，按照正常步骤搭建数据HDR集群，复制关系正常后，关闭两个数据库实例。</p>
<p>5，去掉keepalive的随机自启动：systemctl disable keepalived</p>
<p>6、开启gbasedbtd的随机自启动：systemctl enable gbasedbtd</p>
<p>7，启动主数据库节点：systemctl restart gbasedbtd （会自动带启keepalived）</p>
<p>8，启动从数据库节点：systemctl restart gbasedbtd（会自动带启keepalived）</p>
<h1 id="软件说明"><a href="#软件说明" class="headerlink" title="软件说明"></a>软件说明</h1><ul>
<li><p>功能</p>
<ol>
<li><p>提供vip</p>
</li>
<li><p>提供故障停止库和切换</p>
</li>
<li><p>提供启动时检查是否有主，有加入集群，没有则自启动为主。</p>
</li>
</ol>
</li>
<li><p>组件</p>
<ol>
<li>每2秒执行&#x2F;opt&#x2F;gbkeepalived&#x2F;gbase8s_check.sh检查GBase数据库是否可用，如果不可用，停止keeplive进程。</li>
<li>keeplive升级为主时执行&#x2F;opt&#x2F;gbkeepalived&#x2F;master.sh停止复制关系并升级为主数据库。</li>
<li>keeplive停止时执行&#x2F;opt&#x2F;gbkeepalived&#x2F;stop.sh停止数据库。</li>
<li>oninit.sh为启动脚本，启动数据库时检查集群是否有主存活，有加入集群，没有则自启动为主。并启动keeplive进程。</li>
</ol>
</li>
</ul>
<h1 id="部署步骤"><a href="#部署步骤" class="headerlink" title="部署步骤"></a>部署步骤</h1><h3 id="一、部署环境介绍"><a href="#一、部署环境介绍" class="headerlink" title="一、部署环境介绍"></a>一、部署环境介绍</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">		IP地址        主机名  实例名</span><br><span class="line">节点1：  192.168.1.11  h11   g330pri</span><br><span class="line">节点2：  192.168.1.12  h12   g330hdr</span><br><span class="line">VIP:    192.168.1.13        g330vip</span><br><span class="line"></span><br><span class="line">节点1和节点2 之间搭建HDR集群，DRAUTO设置为0.</span><br><span class="line">节点1和节点2 为一个keepalived组。</span><br></pre></td></tr></table></figure>



<h3 id="二、下载安装keepalived服务"><a href="#二、下载安装keepalived服务" class="headerlink" title="二、下载安装keepalived服务"></a>二、下载安装keepalived服务</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">[root@h11 opt]# tar zxvf keepalived-2.2.7.tar.gz</span><br><span class="line">[root@h12 opt]# tar zxvf keepalived-2.2.7.tar.gz</span><br><span class="line"></span><br><span class="line">[root@h11 keepalived-2.2.7]# yum -y install gcc</span><br><span class="line">[root@h11 keepalived-2.2.7]# yum -y install openssl</span><br><span class="line">[root@h11 keepalived-2.2.7]# yum -y install openssl-devel</span><br><span class="line">[root@h11 opt]# cd keepalived-2.2.7</span><br><span class="line">[root@h11 keepalived-2.2.7]# ./configure --prefix=/usr/local/keepalived --sysconf=/etc</span><br><span class="line">[root@h11 keepalived-2.2.7]# make &amp;&amp; make install</span><br><span class="line">[root@h11 keepalived-2.2.7]# whereis keepalived</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">把keepalive注册为系统服务，但不要开启随机自启动</span></span><br><span class="line">cd /opt/keepalived-2.2.7/keepalived/etc</span><br><span class="line">cp init.d/keepalived /etc/init.d/</span><br><span class="line">cp sysconfig/keepalived /etc/sysconfig/</span><br><span class="line">systemctl daemon-reload</span><br><span class="line">systemctl start keepalived</span><br><span class="line">systemctl disable keepalived</span><br><span class="line">systemctl stop keepalived</span><br></pre></td></tr></table></figure>



<h3 id="三、安装数据库软件"><a href="#三、安装数据库软件" class="headerlink" title="三、安装数据库软件"></a>三、安装数据库软件</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">略.....</span></span><br></pre></td></tr></table></figure>



<h3 id="四、生产配置文件"><a href="#四、生产配置文件" class="headerlink" title="四、生产配置文件"></a>四、生产配置文件</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">上传配置文件的模板 ---------------------------------------------------</span></span><br><span class="line">pc@pc:~/keepdir$ ll</span><br><span class="line">-rw-rw-r--  1 pc pc  4256 6月  13 12:54 config_files.sh</span><br><span class="line">-rw-rw-r--  1 pc pc   285 6月  13 12:54 config_files.txt</span><br><span class="line">-rw-rw-r--  1 pc pc 24206 6月  13 12:54 std.config_files.zip</span><br><span class="line">pc@pc:~/keepdir$</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">查看并修改你的真实参数值 ---------------------------------------------------</span></span><br><span class="line">pc@pc:~/keepdir$ cat config_files.txt</span><br><span class="line">server_nodes 2</span><br><span class="line"></span><br><span class="line">server_pri_node g330pri</span><br><span class="line">server_sec_node g330hdr</span><br><span class="line">server_vip_name g330vip</span><br><span class="line"></span><br><span class="line">server_pri_priority 100</span><br><span class="line">server_sec_priority 90</span><br><span class="line"></span><br><span class="line">server_pri_ip 192.168.1.11/24 9083</span><br><span class="line">server_sec_ip 192.168.1.12/24 9083</span><br><span class="line">server_vip_ip 192.168.1.13/24 9088</span><br><span class="line"></span><br><span class="line">server_pri_eth eth0</span><br><span class="line">server_sec_eth eth0</span><br><span class="line"></span><br><span class="line">pc@pc:~/keepdir$</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">解压配置文件模板包  ---------------------------------------------------</span></span><br><span class="line">pc@pc:~/keepdir$ unzip std.config_files.zip</span><br><span class="line">Archive:  std.config_files.zip</span><br><span class="line">   creating: std.config_files/</span><br><span class="line">  inflating: std.config_files/bash_profile.std</span><br><span class="line">  inflating: std.config_files/config.txt.std</span><br><span class="line">  inflating: std.config_files/crt_gbasedbtd.sh.std</span><br><span class="line">  inflating: std.config_files/gbase8s_check.sh.std</span><br><span class="line">  inflating: std.config_files/keepalived.conf.std</span><br><span class="line">  inflating: std.config_files/master.sh.std</span><br><span class="line">  inflating: std.config_files/onconfig.std</span><br><span class="line">  inflating: std.config_files/oninit.sh.std</span><br><span class="line">  inflating: std.config_files/ontape.sh.std</span><br><span class="line">  inflating: std.config_files/sqlhosts.std</span><br><span class="line">  inflating: std.config_files/stop.sh.std</span><br><span class="line">pc@pc:~/keepdir$ </span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">执行config_files.sh脚本，生成配置文件 ---------------------------------</span></span><br><span class="line">pc@pc:~/keepdir$ pwd</span><br><span class="line">/home/pc/keepdir</span><br><span class="line">pc@pc:~/keepdir$ ll</span><br><span class="line">-rw-rw-r--  1 pc pc  4256 6月  13 11:24 config_files.sh</span><br><span class="line">-rw-rw-r--  1 pc pc   285 6月  13 11:13 config_files.txt</span><br><span class="line">drwxrwxr-x  2 pc pc  4096 6月  13 11:10 std.config_files/</span><br><span class="line">-rw-rw-r--  1 pc pc 23862 6月  13 11:20 std.config_files.zip</span><br><span class="line">pc@pc:~/keepdir$ sh config_files.sh</span><br><span class="line">pc@pc:~/keepdir$</span><br><span class="line">pc@pc:~/keepdir$ ll</span><br><span class="line">drwxrwxr-x  2 pc pc  4096 6月  13 11:27 config_files/      #执行完成会生成这个目录</span><br><span class="line">-rw-rw-r--  1 pc pc  4256 6月  13 11:24 config_files.sh</span><br><span class="line">-rw-rw-r--  1 pc pc   285 6月  13 11:13 config_files.txt</span><br><span class="line">drwxrwxr-x  2 pc pc  4096 6月  13 11:10 std.config_files/</span><br><span class="line">-rw-rw-r--  1 pc pc 23862 6月  13 11:20 std.config_files.zip</span><br><span class="line">pc@pc:~/keepdir$</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">复制配置文件到指定位置  ---------------------------------------------------</span></span><br><span class="line">cd /home/pc/keepdir/config_files</span><br><span class="line"></span><br><span class="line">scp bash_profile_g330pri root@192.168.1.11:/home/gbasedbt/.bash_profile</span><br><span class="line">scp bash_profile_g330hdr root@192.168.1.12:/home/gbasedbt/.bash_profile</span><br><span class="line"></span><br><span class="line">scp keepalived.conf_g330pri_100 root@192.168.1.11:/etc/keepalived/keepalived.conf</span><br><span class="line">scp keepalived.conf_g330hdr_90  root@192.168.1.12:/etc/keepalived/keepalived.conf</span><br><span class="line"></span><br><span class="line">scp gbase8s_check.sh root@192.168.1.11:/home/gbasedbt/</span><br><span class="line">scp gbase8s_check.sh root@192.168.1.12:/home/gbasedbt/</span><br><span class="line"></span><br><span class="line">scp master.sh root@192.168.1.11:/home/gbasedbt/</span><br><span class="line">scp master.sh root@192.168.1.12:/home/gbasedbt/</span><br><span class="line"></span><br><span class="line">scp stop.sh root@192.168.1.11:/home/gbasedbt/</span><br><span class="line">scp stop.sh root@192.168.1.12:/home/gbasedbt/</span><br><span class="line"></span><br><span class="line">GBASEDBTDIR=/opt/install/g330</span><br><span class="line">scp oninit.sh root@192.168.1.11:$GBASEDBTDIR/bin/</span><br><span class="line">scp oninit.sh root@192.168.1.12:$GBASEDBTDIR/bin/</span><br><span class="line"></span><br><span class="line">scp sqlhosts root@192.168.1.11:$GBASEDBTDIR/etc/</span><br><span class="line">scp sqlhosts root@192.168.1.12:$GBASEDBTDIR/etc/</span><br><span class="line"></span><br><span class="line">scp onconfig.g330pri root@192.168.1.11:$GBASEDBTDIR/etc/</span><br><span class="line">scp onconfig.g330hdr root@192.168.1.12:$GBASEDBTDIR/etc/</span><br><span class="line"></span><br><span class="line">scp crt_gbasedbtd.sh root@192.168.1.11:/home/gbasedbt/</span><br><span class="line">scp crt_gbasedbtd.sh root@192.168.1.12:/home/gbasedbt/</span><br></pre></td></tr></table></figure>



<h3 id="五、搭建数据库集群"><a href="#五、搭建数据库集群" class="headerlink" title="五、搭建数据库集群"></a>五、搭建数据库集群</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11和192.168.1.12上执行 --------------------------------</span></span><br><span class="line">su - gbasedbt</span><br><span class="line">sed -i &#x27;s/192.168.1.13/0.0.0.0/&#x27; $GBASEDBTDIR/etc/sqlhosts</span><br><span class="line">sed -i &#x27;s/^FULL_DISK_INIT.*$/FULL_DISK_INIT 1/&#x27; $GBASEDBTDIR/etc/$ONCONFIG</span><br><span class="line">sed -i &#x27;s/^PHYSFILE.*$/#PHYSFILE/&#x27; $GBASEDBTDIR/etc/$ONCONFIG</span><br><span class="line">sed -i &#x27;s/^LOGFILES.*$/#LOGFILES/&#x27; $GBASEDBTDIR/etc/$ONCONFIG</span><br><span class="line">sed -i &#x27;s/^LOGSIZE.*$/#LOGSIZE/&#x27; $GBASEDBTDIR/etc/$ONCONFIG</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11上执行 -----------------------------------------------</span></span><br><span class="line">oninit -ivy</span><br><span class="line"></span><br><span class="line">ontape -s -L 0 -t STDIO -F |ssh 192.168.1.12 &quot;. /home/gbasedbt/.bash_profile; onmode -ky;onclean -ky;ontape -p -t STDIO&quot;</span><br><span class="line"></span><br><span class="line">onmode -d primary g330hdr</span><br><span class="line"></span><br><span class="line">ssh 192.168.1.12 &quot;. /home/gbasedbt/.bash_profile; onmode -d secondary g330pri&quot;</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">GBase123!</span></span><br></pre></td></tr></table></figure>



<h3 id="六、关闭数据库"><a href="#六、关闭数据库" class="headerlink" title="六、关闭数据库"></a>六、关闭数据库</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.12上执行 --------------------------------</span></span><br><span class="line">onmode -ky</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11上执行 --------------------------------</span></span><br><span class="line">onmode -ky</span><br></pre></td></tr></table></figure>

<h3 id="七、配置gbasedbtd服务"><a href="#七、配置gbasedbtd服务" class="headerlink" title="七、配置gbasedbtd服务"></a>七、配置gbasedbtd服务</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">root用户在192.168.1.11和192.168.1.12上执行 --------------------------------</span></span><br><span class="line">/home/gbasedbt/crt_gbasedbtd.sh</span><br></pre></td></tr></table></figure>

<h3 id="八、启动gbasedbtd服务"><a href="#八、启动gbasedbtd服务" class="headerlink" title="八、启动gbasedbtd服务"></a>八、启动gbasedbtd服务</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11上执行 --------------------------------</span></span><br><span class="line">systemctl start gbasedbtd</span><br><span class="line">systemctl status gbasedbtd</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">等等主实例正常后</span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">再在192.168.1.12上执行 --------------------------------</span></span><br><span class="line">systemctl start gbasedbtd</span><br><span class="line">systemctl status gbasedbtd</span><br></pre></td></tr></table></figure>

<h3 id="九、检查keepalived是否启动"><a href="#九、检查keepalived是否启动" class="headerlink" title="九、检查keepalived是否启动"></a>九、检查keepalived是否启动</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11和192.168.1.12上执行 --------------------------------</span></span><br><span class="line">ps -ef |grep keep</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="十、检查数据库集群和VIP"><a href="#十、检查数据库集群和VIP" class="headerlink" title="十、检查数据库集群和VIP"></a>十、检查数据库集群和VIP</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11和192.168.1.12上执行 --------------------------------</span></span><br><span class="line">ip a |grep 192.168.1.13</span><br><span class="line">onstat -g dri</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h3 id="十一、查看KeepalivedGBase8s运行日志"><a href="#十一、查看KeepalivedGBase8s运行日志" class="headerlink" title="十一、查看KeepalivedGBase8s运行日志"></a>十一、查看KeepalivedGBase8s运行日志</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">在192.168.1.11和192.168.1.12上执行 --------------------------------</span></span><br><span class="line">tail -20 /tmp/online.keeplive.log</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">修复内容记录：2023年6月12日</span><br><span class="line">	1、完善了readmi文档，简化了部署流程。</span><br><span class="line">	2、修复了gbase8s_check.sh里面对killall环境的检测判断。</span><br><span class="line">	3、修复了ononit.sh里面的启动不成功情况，清理自身。</span><br><span class="line">	4、修复了crt_gbasedbtd.sh配置和启动分离。</span><br><span class="line">	5、修复了keepalived自启动冲突，有gbasedbtd服务统一管理。</span><br><span class="line">	6、统一了日志输出到 /tmp/online.keeplive.log。</span><br><span class="line"></span><br><span class="line">修复内容记录：2023年6月13日 （打包标记：leopard）</span><br><span class="line">	7、修复了sqlhosts0.0.0.0 配置。 </span><br><span class="line">	8、修复了LANG环境变量也设置了en.US。</span><br><span class="line">	9、修复了gbase8s_check.sh关闭数据库和keepalived的日志输入出。</span><br><span class="line">	10、完善了oninit.sh启动时尝试10次找集群中主节点的尝试。</span><br><span class="line">	11、完善了oninit.sh检测结果的日志输出。</span><br><span class="line">	12、完善了master.sh升级为主节点后自动重启一遍vip上的监听服务。</span><br><span class="line">	13、完善了sopt.sh的日志输出。</span><br><span class="line"></span><br></pre></td></tr></table></figure> 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <div class="declare">
      <ul class="post-copyright">
        <li>
          <i class="ri-copyright-line"></i>
          <strong>Copyright： </strong>
          
          Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
          
        </li>
      </ul>
    </div>
    
    <footer class="article-footer">
       
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://example.com/2023/06/15/%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%ACKeepalivedGBase8s-leopard-%E7%8C%8E%E8%B1%B9%E7%89%88/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>  
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/GBasedbtd/" rel="tag">GBasedbtd</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Keepalived/" rel="tag">Keepalived</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%87%AA%E7%A0%94/" rel="tag">自研</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9B%86%E7%BE%A4/" rel="tag">集群</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%AB%98%E5%8F%AF%E7%94%A8/" rel="tag">高可用</a></li></ul>

    </footer>
  </div>

   
  <nav class="article-nav">
    
      <a href="/2023/06/15/%E8%87%AA%E5%88%B6%E5%B7%A5%E5%85%B7%EF%BC%9AdumpTBLSpaceAndPE-sh/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            自制工具：dumpTBLSpaceAndPE.sh
          
        </div>
      </a>
    
    
      <a href="/2023/06/15/ESQLC%E6%B5%8B%E8%AF%95GBase8s%E6%B8%B8%E6%A0%87%E7%A8%B3%E5%AE%9A%E6%80%A7%E8%AF%BB/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">ESQLC测试GBase8s游标稳定性读</div>
      </a>
    
  </nav>

  
   
  
    
</article>

</section>
      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2023-2024
        <i class="ri-heart-fill heart_icon"></i> Wang Wei
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ww.ico" alt="朝花夕拾"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->
 
<script src="/js/tocbot.min.js"></script>

<script>
  tocbot.init({
    tocSelector: ".tocbot",
    contentSelector: ".article-entry",
    headingSelector: "h1, h2, h3, h4, h5, h6",
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer: "main",
    positionFixedSelector: ".tocbot",
    positionFixedClass: "is-position-fixed",
    fixedSidebarOffset: "auto",
  });
</script>

<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->

<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>